package com.example.denglu;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    private Button button6;
    private EditText editTextTextPersonName;
    private EditText editTextTextPersonName2;
    private EditText editTextTextPersonName3;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Log.d("MainActivity","调用onCreate()");

        editTextTextPersonName = (EditText) findViewById(R.id.editTextTextPersonName);
        editTextTextPersonName2 = (EditText) findViewById(R.id.editTextTextPersonName2);
        editTextTextPersonName3 = (EditText) findViewById(R.id.editTextTextPersonName3);

        button6= (Button) findViewById(R.id.button6);
        button6.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(MainActivity.this,MainActivity2.class);

                intent.putExtra("editTextTextPersonName",editTextTextPersonName.getText().toString());
                intent.putExtra("editTextTextPersonName2",editTextTextPersonName2.getText().toString());
                intent.putExtra("editTextTextPersonName3",editTextTextPersonName3.getText().toString());
                startActivity(intent);
            }
        });
    }

    @Override
    protected  void onStart() {
        super.onStart();
        Log.d("MainActivity","调用onStart()");
    }

    @Override
    protected  void onResume() {
        super.onResume();
        Log.d("MainActivity","调用onResume()");
    }

    @Override
    protected  void onPause() {
        super.onPause();
        Log.d("MainActivity","调用onPause()");
    }

    @Override
    protected  void onStop() {
        super.onStop();
        Log.d("MainActivity","调用onStop()");
    }

    @Override
    protected  void onDestroy() {
        super.onDestroy();
        Log.d("MainActivity","调用onDestroy()");
    }

    @Override
    protected  void onRestart() {
        super.onRestart();
        Log.d("MainActivity","调用onRestart()");
    }
}